#ifndef ConferenceInfoSetMessage_H
#define ConferenceInfoSetMessage_H

#include "ControlMessage.h"
/**
 * @brief 会控消息 conf.info.set
 *
 */

class ConferenceInfoSetMessage : public ControlMessage
{
   public:
    using Ptr = std::shared_ptr<ConferenceInfoSetMessage>;

    ConferenceInfoSetMessage() {}
    ~ConferenceInfoSetMessage() {}

    bool fromJsonObject(const Json::Value& object) override
    {
        if (!ControlMessage::fromJsonObject(object))
            return false;
        return _parse(object);
    }

    const std::string& getSubject()
    {
        return _subject;
    }
    const std::string& getEmcee()
    {
        return _emcee;
    }
    friend std::ostream& operator<<(std::ostream& os, const ConferenceInfoSetMessage::Ptr& obj)
    {
        if (!obj)
        {
            return os << "conf.info.set{nullptr}";
        }
        os << obj->_event << "{confId=" << obj->_conferenceId
           << ", number=" << obj->_number
           << ", subject=" << obj->_subject
           << "}";
        return os;
    }

   public:
    bool _parse(const Json::Value& message) override
    {
        _subject = FastJsoncpp::GET_STR(message, "subject");
        _emcee = FastJsoncpp::GET_STR(message, "emcee");
        return true;
    }

   private:
    std::string _subject;
    std::string _emcee;
};
#endif
